Need help with display of attribute from linked module

I want to display an attribute from a specific module that is linked (out-link). With the below script I can display attributes that are common to any of the linked modules. What I want to do is only read and display from a specific module that has attributes that are unique to that module. Can the attached script be modified to so that?
Chris_J1234 - Wed Jul 22 11:29:09 EDT 2009

Re: Need help with display of attribute from linked module
llandale - Wed Jul 22 14:02:06 EDT 2009

First off: you need more defense in the script such as checking whether oTarget is null; which will happen if you have R access to the module but not the Object.

I see you get DXL errors for those linked modules that don't have attrs S_ATTR_1/2.

There is a function probeAttr_(Object, string NameAttr) that retrieves values. It returns null of the attribute doesn't exist trapping and ignoring access errors.

<1> Thus you could stage the values and only display them if they are non-null:

string Value = probeAttr_(oTarget, S_ATTR_1)
if (!null Value) display(S_ATTR_1 ": " Value)

Notice that you get nothing if the attr exists but the object has no value for it.

<2> You could also check the existence of the attribute in the target module, and display the value even if its null:

Module mTarget = target(l)
if (!null find(mTarget, S_ATTR_A))
{ display (S_ATTR_1 ": " oTarget.S_ATTR_1 "")
}

  • Louie

Re: Need help with display of attribute from linked module
ChrisAnnal - Fri Jul 24 10:18:12 EDT 2009

The easiest way to do what you want is to use the DOORS built-in Analysis Wizard to follow the outgoing link to a specific module, and select the specific attribute you want from the windows that pop up when you use the Wizard. When you're all done, the new column that is inserted will contain all the DXL that was used to get that information. I've used this approach numerous times to both perform needed tasks and to use as a basis for personal scripts I was developing.
See attached "How To". I hope this helps.

Re: Need help with display of attribute from linked module
ChrisAnnal - Fri Jul 24 10:46:08 EDT 2009

ChrisAnnal - Fri Jul 24 10:18:12 EDT 2009
The easiest way to do what you want is to use the DOORS built-in Analysis Wizard to follow the outgoing link to a specific module, and select the specific attribute you want from the windows that pop up when you use the Wizard. When you're all done, the new column that is inserted will contain all the DXL that was used to get that information. I've used this approach numerous times to both perform needed tasks and to use as a basis for personal scripts I was developing.
See attached "How To". I hope this helps.

Here's the document.
Attachments

attachment_14278134_Use_Analysis_Wizard_to_get_information_f.doc